package com.wyk.controller;

import com.wyk.pojo.User;
import com.wyk.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class UserController {
    @Autowired
    private UserServiceImpl userService;
    @RequestMapping("/book")
    public String BookByid(Integer id, Model model) {
        User userByid = userService.findUserByid(id);
        System.out.println(userByid);
        model.addAttribute("user",userByid);
        return "user";
    }

    @RequestMapping("/login111")
    public void add(HttpServletRequest request, Model model) {
        String username = request.getParameter("username");
        String sex = request.getParameter("sex");
        System.out.println(username+"!!!!!!!!!");
        System.out.println(sex+"!!!!!!!!!");

    }
}
